<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var data = new Date()
    function dataStyle(data) {
        var year = data.getFullYear();
        var month = data.getMonth() + 1;
        var dat = data.getDate();
        var day = data.getDay();
        var h = data.getHours();
        var m = data.getMinutes();
        var s = data.getSeconds();
        var arr = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
        var obj = {data:data,year:year,month:month,dat:dat,day:day,h:h,m:m,s:s}
        return obj
    }
    console.log(dataStyle(data))
</script>

</html>